//
//  SelfIdCardTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/12/15.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "SelfIdCardTableViewCell.h"

@implementation SelfIdCardTableViewCell{
    GLGWImageView * positiveImageView;
    GLGWImageView * reverseImageView;
    GLGWLabel * carTYpeLabel;
    GLGWLabel * resuleLabel;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat imageViewWidth = (KScreenWidth - kWidthProportion_In_iPhoneTriploid(45))/2;
        positiveImageView = [[GLGWImageView alloc] initWithImageName:@"rr" inSuperView:self.contentView];
        positiveImageView.backgroundColor = kRandomColor;
        [positiveImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.equalTo(self.contentView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(33));
            make.width.equalTo(@(imageViewWidth));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(104)));
        }];
        //
        reverseImageView = [[GLGWImageView alloc] initWithImageName:@"uu" inSuperView:self.contentView];
        reverseImageView.backgroundColor = kRandomColor;
        [reverseImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self->positiveImageView.mas_right).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.width.height.equalTo(self->positiveImageView);
        }];
        //
        carTYpeLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self.contentView];
        carTYpeLabel.text = @"您的实名认证未通过";
        [carTYpeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.contentView);
            make.top.equalTo(self->positiveImageView.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(13));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(20)));
        }];
        //
        resuleLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#EC5353"] inSuperView:self.contentView];
        resuleLabel.text = @"证件不清晰";
        [resuleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.contentView);
            make.top.equalTo(self->carTYpeLabel.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(8));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(20)));
        }];
        //
        GLGWButton * conBut = [[GLGWButton alloc] initWithTitle:@"重新认证" titleLableFont:SYSTEMFONT(12) titleLableColor:[UIColor whiteColor] theCornerRadius:kHeightProportion_In_iPhoneTriploid(15) backgroundColr:kColor_Rule_Yellow inSuperView:self.contentView];
        [conBut mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.contentView);
            make.top.equalTo(self->resuleLabel.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(28));
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(130)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(30)));
            make.bottom.equalTo(self.contentView.mas_bottom).offset(-kHeightProportion_In_iPhoneTriploid(77));
        }];
        [conBut addTarget:self action:@selector(comintAction) forControlEvents:UIControlEventTouchUpInside];
    }
     return self;
}

-(void)comintAction{
    if (self.Block_idCardComint) {
        self.Block_idCardComint();
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
